Skip to content

feat: add funnel conversion tracking, ML forecasting, A/B testing, customer health (#852 #853 #854 #855) - #897

Merged
Smartdevs17 merged 4 commits into
Smartdevs17:mainfrom
SagaciousBoss:feat/issues-852-853-854-855
Sep 28, 2026
Merged

Smartdevs17 merged 4 commits into
Smartdevs17:mainfrom
SagaciousBoss:feat/issues-852-853-854-855

Conversation

@SagaciousBoss

Copy link
Copy Markdown
Contributor

Closes #852
Closes #853
Closes #854
Closes #855

Summary

This PR implements all four requested features:

#852 Build A/B testing framework

  • Service \�ackend/src/services/ab-testing.ts\ (\ABTestingService) with deterministic MD5 bucketing, weighted variants, traffic allocation, lifecycle (draft/running/paused/completed/archived)
  • Statistical significance: two-proportion z-test (pooled), Wilson score interval, Bayesian Beta-Binomial, sample size calculator
  • Routes \�ackend/src/routes/ab-testing.ts\ at /api/v1/ab-tests\
  • Tests: \�ackend/src/services/tests/ab-testing.test.ts\ + docs \�ackend/docs/AB_TESTING.md\

#853 Add funnel conversion tracking

  • Service \�ackend/src/services/funnel-tracking.ts\ (\FunnelTrackingService) — custom funnel definitions, step ordering, conversion window, per-step stats (entered/conversionRate/stepConversionRate/dropOff/avg/median/p95 time to next), user journey, CSV export
  • Routes \�ackend/src/routes/funnel-tracking.ts\ at /api/v1/funnels\
  • Tests + docs

#854 Implement revenue forecasting with ML

  • Service \�ackend/src/services/ml-forecast.ts\ (\MLForecastService) — ensemble (linear, polynomial degree 2, exponential smoothing, Holt-Winters seasonal, moving average) with cross-validated model selection (80/20 holdout, RMSE), confidence intervals, seasonality detection via autocorrelation
  • Routes \�ackend/src/routes/ml-forecast.ts\ at /api/v1/forecast/ml\

#855 Build customer health score system

  • Service \�ackend/src/services/customer-health.ts\ (\CustomerHealthService) — composite 0-100 (payment 30% + frequency 20% + recency 20% + engagement 15% + support 15%) with churn penalties, levels champion/healthy/at_risk/critical, trends, at-risk listing, distribution
  • Routes \�ackend/src/routes/customer-health.ts\ at /api/v1/customer-health\

All routers registered in \�ackend/src/index.ts.

…stomer health (Smartdevs17#852 Smartdevs17#853 Smartdevs17#854 Smartdevs17#855)

- Funnel conversion tracking (Smartdevs17#853): custom funnel definitions, step tracking, conversion rates, drop-offs, time-to-convert, cohort windows, user journey
- Revenue forecasting with ML (Smartdevs17#854): ensemble models (linear, polynomial, Holt-Winters, exponential smoothing, MA) with cross-validation, confidence intervals, seasonality detection, trend analysis
- A/B testing framework (Smartdevs17#852): generic experiments, deterministic weighted assignment, traffic allocation, statistical significance (z-test, Wilson, Bayesian), lifecycle management, sample size calculator
- Customer health score (Smartdevs17#855): composite 0-100 health based on payment, frequency, recency, engagement, support signals with at-risk detection, distribution, trends and recommendations

Closes Smartdevs17#852, Closes Smartdevs17#853, Closes Smartdevs17#854, Closes Smartdevs17#855
@vercel

vercel Bot commented Sep 24, 2026

Copy link
Copy Markdown

@SagaciousBoss is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Sep 24, 2026

Copy link
Copy Markdown

@SagaciousBoss Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Smartdevs17
Smartdevs17 merged commit 792b09f into Smartdevs17:main Sep 28, 2026
1 check passed
@gitguardian

gitguardian Bot commented Sep 28, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
15742864 Triggered Generic Password 91be765 .github/workflows/backup.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build customer health score system Implement revenue forecasting with ML Add funnel conversion tracking Build A/B testing framework

2 participants